﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared.Master" AutoEventWireup="true"
    CodeBehind="schedule.aspx.cs" Inherits="Lawyer.Web.schedule" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SideBar" runat="server">
    <nav>
    <a class="chevron" href="#">»</a>
    <ul>
                                <li><a href="activityadd.aspx">New Activity</a></li>
                                <li><a href="activity.aspx">All List</a></li>
                                <li><a href="activity.aspx?status=2"> To do list</a></li>
                                <li><a href="activity.aspx?status=3">Job done List</a></li>
<li class="current"><a href="schedule.aspx">Schedule</a>
    </ul>
</nav>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mainContent" runat="server">

    <script type='text/javascript'>

	$(document).ready(function() {
		var date = new Date();
		var d = date.getDate();
		var m = date.getMonth();
		var y = date.getFullYear();
        var eventtitle = $( "#event-title" )
        var estart, eend, eallDay;

		var calendar = $('#calendar').fullCalendar({
            theme: true,
			header: {
				left: 'prev,next today',
				center: 'title',
				right: 'month,agendaWeek,agendaDay'
			},
            selectable: false,
			selectHelper: false,
			editable: false,
			allDay:false,
			events: 
			//[{"id":1,"title":"fff","start":"2011-9-1 5:00:00","end":"2011-9-1 8:00:00",allDay:false}]
			"Ajax/ajax_schedule.aspx"

		});
        
        // increase the default animation speed to exaggerate the effect
        $.fx.speeds._default = 1000;
		$( "#create-event-form" ).dialog({
			autoOpen: false,
			height: 128,
			width: 350,
			modal: true,
            resizable: false,
            hide: 'fade',
            show: 'fade',
			buttons: {
				"Create Event": function() {
					var bValid = true;
					eventtitle.removeClass( "ui-state-error" );

					bValid = bValid && eventtitle.val() != '';

					if ( bValid ) {
                        var title = eventtitle.val();
                        calendar.fullCalendar('renderEvent',
                            {
                                title: title,
                                start: estart,
                                end: eend,
                                allDay: eallDay
                            },
                            true // make the event "stick"
                        );

                        calendar.fullCalendar('unselect');
						$( this ).dialog( "close" );
					}
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				}
			},
            close: function() {
                eventtitle.val("").removeClass( "ui-state-error" );
                estart=eend=eallDay=null;
            }
		});
	});

</script>

    <div class="main-content">
        <header>
                            <ul class="action-buttons clearfix">
                                <%--<li><a href="account" class="button" data-icon-primary="ui-icon-wrench" data-icon-only="true">Options</a></li>
                                <li><a href="documentation/index.html" class="button help" rel="#overlay" data-icon-primary="ui-icon-help" data-icon-only="true">Help</a></li>
                          --%>  </ul>
                            <h2>
                                Calendar
                            </h2>
                        </header>
        <section class="container_6 clearfix">
                            <div id='calendar' class="grid_6"></div>
                        </section>
    </div>
</asp:Content>
